import React from 'react';
import {Table, message, Affix, Alert, Row, Col, Popconfirm} from 'antd';
import PropTypes from 'prop-types';
import {hasPermissions} from './utils';
import {conventEnumValueToString, formatDateTime} from '../utils';
import {PERMISSION} from './constants';
import DropdownMenu from 'Shared/components/DropdownMenu';
import {TABLE, PAGINATION_OPTIONS, COMMON_TABLE_QUERY_FAIL_TEXT, COMMON_TABLE_EMPTY_TEXT,
    FIXED_COLUMN_WIDTH, DATE_FORMAT, ROWSELECTION_FIXED_COLUMN_WIDTH} from '../constants';
import WrappedPopconfirm from '../common/WrappedPopconfirm';
import {salePlanAssembleMethod, salePlanStatus} from '../Enum';
import {abandonData, submitData} from './api';
import styles from './style.css';
export class TablePanel extends React.PureComponent {
    constructor(props) {
        super(props);
        this.onChangeSort = this.onChangeSort.bind(this);
        this.state = {
            loading: false
        };
    }
    // 避免 Popconfirm 随滚动条移动
    getPopupContainer = trigger => trigger.parentNode;

    // Popconfirm autoAdjustOverflow 仅在 render 时计算一次位置
    // Popconfirm 展开时，Affix 切换至固定状态，Popconfirm 没有自动从 Top 切换至 Botton
    // 如果存在性能问题，考虑暂时移除
    affixOnChange = () => this.forceUpdate();

    onChangeSort = (pagination, filters, sorter) => {
        this.props.onChangeSort({
            pageIndex: pagination.current - 1,
            pageSize: pagination.pageSize,
            sortedColumnKey: sorter.columnKey,
            sortedOrder: sorter.order,
        });
    };
    onClickAbandonBtn = id => {
        this.setState({loading: true});
        const record = this.props.data.find(d => d.id === id);
        abandonData([{id,
            rowVersion: record.rowVersion}])
            .then(res => {
                this.setState({loading: false});
                if(res.ok)
                    this.props.refreshListData();
            });
    }
    onClickSubmitBtn = id => {
        this.setState({loading: true});
        const record = this.props.data.find(d => d.id === id);
        submitData([{id,
            rowVersion: record.rowVersion}])
            .then(res => {
                this.setState({loading: false});
                if(res.ok)
                    this.props.refreshListData();
            });
    }
    onClickBatchAbandon = () => {
        const selectIds = this.state.selectedRowKeys;
        if(!selectIds || selectIds.length === 0)
            message.warning(this.props.intl.formatMessage({
                id: 'tablePanel.btn.ValidationMessage',
                defaultMessage: '请选择需要批量操作的单据'
            }));
        else {
            this.setState({loading: true});
            const data = this.props.data.filter(item => selectIds.includes(item.id)).map(item => ({
                id: item.id,
                rowVersion: item.rowVersion
            }));
            abandonData(data).then(res => {
                this.setState({loading: false});
                if(res.ok) {
                    this.props.onChangeSort();
                    this.onEndBatchOperationAbandon();
                }
            });
        }
    }
    onClickBatchSubmit = () => {
        const selectIds = this.state.selectedRowKeys;
        if(!selectIds || selectIds.length === 0)
            message.warning(this.props.intl.formatMessage({
                id: 'tablePanel.btn.ValidationMessage',
                defaultMessage: '请选择需要批量操作的单据'
            }));
        else {
            this.setState({loading: true});
            const data = this.props.data.filter(item => selectIds.includes(item.id)).map(item => ({
                id: item.id,
                rowVersion: item.rowVersion
            }));
            submitData(data).then(res => {
                this.setState({loading: false});
                if(res.ok) {
                    this.props.onChangeSort();
                    this.onEndBatchOperationSubmit();
                }
            });
        }
    }
    onEndBatchOperationAbandon = () => {
        this.setState({selectedRowKeys: []});
        this.props.onEndBatchOperationAbandon();
    }
    onEndBatchOperationSubmit = () => {
        this.setState({selectedRowKeys: []});
        this.props.onEndBatchOperationSubmit();
    }
    onSelectedChange = keys => this.setState({selectedRowKeys: keys});
    render() {
        const {formatMessage} = this.props.intl;
        const {pageIndex, pageSize, total} = this.props;
        const locale = {
            emptyText: this.props.hasError ? COMMON_TABLE_QUERY_FAIL_TEXT : COMMON_TABLE_EMPTY_TEXT
        };
        const pagination = {
            total,
            pageSize,
            current: pageIndex + 1,
            ...PAGINATION_OPTIONS
        };
        const columns = [{
            title: formatMessage({
                id: 'tablePanel.column.brandCode',
                defaultMessage: '品牌'
            }),
            dataIndex: 'brandCode',
            render: (text, r) => `(${text})${r.brandName}`
        }, {
            title: formatMessage({
                id: 'tablePanel.column.marketDepartmentName',
                defaultMessage: '大区'
            }),
            dataIndex: 'marketDepartmentName',
            sorter: true,
            sortOrder: this.props.sortedColumnKey === 'marketDepartmentName' && this.props.sortedOrder
        }, {
            title: formatMessage({
                id: 'tablePanel.column.country',
                defaultMessage: '国家'
            }),
            dataIndex: 'country',
            sorter: true,
            sortOrder: this.props.sortedColumnKey === 'country' && this.props.sortedOrder
        }, {
            title: formatMessage({
                id: 'tablePanel.column.dealerCode',
                defaultMessage: '总代编号'
            }),
            dataIndex: 'dealerCode',
            sorter: true,
            sortOrder: this.props.sortedColumnKey === 'dealerCode' && this.props.sortedOrder
        }, {
            title: formatMessage({
                id: 'tablePanel.column.dealerName',
                defaultMessage: '总代名称'
            }),
            dataIndex: 'dealerName',
            sorter: true,
            sortOrder: this.props.sortedColumnKey === 'dealerName' && this.props.sortedOrder
        }, {
            title: formatMessage({
                id: 'tablePanel.column.manufacturerCode',
                defaultMessage: '生产工厂编号'
            }),
            dataIndex: 'manufacturerCode',
        }, {
            title: formatMessage({
                id: 'tablePanel.column.manufacturerName',
                defaultMessage: '生产工厂名称'
            }),
            dataIndex: 'manufacturerName',
        }, {
            title: formatMessage({
                id: 'tablePanel.column.submitYear',
                defaultMessage: '提报年份'
            }),
            dataIndex: 'submitYear',
        }, {
            title: formatMessage({
                id: 'tablePanel.column.submitMonth',
                defaultMessage: '提报月份'
            }),
            dataIndex: 'submitMonth',
        }, {
            title: formatMessage({
                id: 'tablePanel.column.assembleMethod',
                defaultMessage: '装配方式'
            }),
            dataIndex: 'assembleMethod',
            render: text => conventEnumValueToString(salePlanAssembleMethod, text)
        }, {
            title: formatMessage({
                id: 'tablePanel.column.versionCode',
                defaultMessage: '版型编号'
            }),
            dataIndex: 'versionCode',
        }, {
            title: formatMessage({
                id: 'tablePanel.column.versionName',
                defaultMessage: '版型名称'
            }),
            dataIndex: 'versionName',
        }, {
            title: formatMessage({
                id: 'tablePanel.column.modelCode',
                defaultMessage: '车型编号'
            }),
            dataIndex: 'modelCode',
        }, {
            title: formatMessage({
                id: 'tablePanel.column.modelName',
                defaultMessage: '车型名称'
            }),
            dataIndex: 'modelName',
        }, {
            title: formatMessage({
                id: 'tablePanel.column.kdAnnualBeginningInventory',
                defaultMessage: 'KD年度期初库存'
            }),
            dataIndex: 'kdAnnualBeginningInventory',
        }, {
            title: formatMessage({
                id: 'tablePanel.column.cbuAnnualBeginningInventory',
                defaultMessage: '整车年度期初库存'
            }),
            dataIndex: 'cbuAnnualBeginningInventory'
        }, {
            title: formatMessage({
                id: 'tablePanel.column.n1SalesTargetQuantity',
                defaultMessage: 'N+1月实销目标'
            }),
            dataIndex: 'n1SalesTargetQuantity',
        }, {
            title: formatMessage({
                id: 'tablePanel.column.n2SalesTargetQuantity',
                defaultMessage: 'N+2月实销目标'
            }),
            dataIndex: 'n2SalesTargetQuantity',
        }, {
            title: formatMessage({
                id: 'tablePanel.column.n3SalesTargetQuantity',
                defaultMessage: 'N+3月实销目标'
            }),
            dataIndex: 'n3SalesTargetQuantity',
        }, {
            title: formatMessage({
                id: 'tablePanel.column.n4SalesTargetQuantity',
                defaultMessage: 'N+4月实销目标'
            }),
            dataIndex: 'n4SalesTargetQuantity',
        }, {
            title: formatMessage({
                id: 'tablePanel.column.n5SalesTargetQuantity',
                defaultMessage: 'N+5月实销目标'
            }),
            dataIndex: 'n5SalesTargetQuantity',
        }, {
            title: formatMessage({
                id: 'tablePanel.column.n6SalesTargetQuantity',
                defaultMessage: 'N+6月实销目标'
            }),
            dataIndex: 'n6SalesTargetQuantity',
        }, {
            title: formatMessage({
                id: 'tablePanel.column.n7SalesTargetQuantity',
                defaultMessage: 'N+7月实销目标'
            }),
            dataIndex: 'n7SalesTargetQuantity',
        }, {
            title: formatMessage({
                id: 'tablePanel.column.n8SalesTargetQuantity',
                defaultMessage: 'N+8月实销目标'
            }),
            dataIndex: 'n8SalesTargetQuantity',
        }, {
            title: formatMessage({
                id: 'tablePanel.column.n9SalesTargetQuantity',
                defaultMessage: 'N+9月实销目标'
            }),
            dataIndex: 'n9SalesTargetQuantity',
        }, {
            title: formatMessage({
                id: 'tablePanel.column.n10SalesTargetQuantity',
                defaultMessage: 'N+10月实销目标'
            }),
            dataIndex: 'n10SalesTargetQuantity',
        }, {
            title: formatMessage({
                id: 'tablePanel.column.n11SalesTargetQuantity',
                defaultMessage: 'N+11月实销目标'
            }),
            dataIndex: 'n11SalesTargetQuantity',
        }, {
            title: formatMessage({
                id: 'tablePanel.column.n12SalesTargetQuantity',
                defaultMessage: 'N+12月实销目标'
            }),
            dataIndex: 'n12SalesTargetQuantity',
        }, {
            title: formatMessage({
                id: 'tablePanel.column.salesTargetQuantityTotal',
                defaultMessage: '实销目标合计'
            }),
            dataIndex: 'salesTargetQuantityTotal',
        }, {
            title: formatMessage({
                id: 'tablePanel.column.n1PurchasePlanQuantity',
                defaultMessage: 'N+1月提车计划'
            }),
            dataIndex: 'n1PurchasePlanQuantity',
        }, {
            title: formatMessage({
                id: 'tablePanel.column.n2PurchasePlanQuantity',
                defaultMessage: 'N+2月提车计划'
            }),
            dataIndex: 'n2PurchasePlanQuantity',
        }, {
            title: formatMessage({
                id: 'tablePanel.column.n3PurchasePlanQuantity',
                defaultMessage: 'N+3月提车计划'
            }),
            dataIndex: 'n3PurchasePlanQuantity',
        }, {
            title: formatMessage({
                id: 'tablePanel.column.n4PurchasePlanQuantity',
                defaultMessage: 'N+4月提车计划'
            }),
            dataIndex: 'n4PurchasePlanQuantity',
        }, {
            title: formatMessage({
                id: 'tablePanel.column.n5PurchasePlanQuantity',
                defaultMessage: 'N+5月提车计划'
            }),
            dataIndex: 'n5PurchasePlanQuantity',
        }, {
            title: formatMessage({
                id: 'tablePanel.column.n6PurchasePlanQuantity',
                defaultMessage: 'N+6月提车计划'
            }),
            dataIndex: 'n6PurchasePlanQuantity',
        }, {
            title: formatMessage({
                id: 'tablePanel.column.n7PurchasePlanQuantity',
                defaultMessage: 'N+7月提车计划'
            }),
            dataIndex: 'n7PurchasePlanQuantity',
        }, {
            title: formatMessage({
                id: 'tablePanel.column.n8PurchasePlanQuantity',
                defaultMessage: 'N+8月提车计划'
            }),
            dataIndex: 'n8PurchasePlanQuantity',
        }, {
            title: formatMessage({
                id: 'tablePanel.column.n9PurchasePlanQuantity',
                defaultMessage: 'N+9月提车计划'
            }),
            dataIndex: 'n9PurchasePlanQuantity',
        }, {
            title: formatMessage({
                id: 'tablePanel.column.n10PurchasePlanQuantity',
                defaultMessage: 'N+10月提车计划'
            }),
            dataIndex: 'n10PurchasePlanQuantity',
        }, {
            title: formatMessage({
                id: 'tablePanel.column.n11PurchasePlanQuantity',
                defaultMessage: 'N+11月提车计划'
            }),
            dataIndex: 'n11PurchasePlanQuantity',
        }, {
            title: formatMessage({
                id: 'tablePanel.column.n12PurchasePlanQuantity',
                defaultMessage: 'N+12月提车计划'
            }),
            dataIndex: 'n12PurchasePlanQuantity',
        }, {
            title: formatMessage({
                id: 'tablePanel.column.purchasePlanQuantityTotal',
                defaultMessage: '提车计划合计'
            }),
            dataIndex: 'purchasePlanQuantityTotal',
        }, {
            title: formatMessage({
                id: 'tablePanel.column.n1KDProductPlanQuantity',
                defaultMessage: 'N+1月KD生产计划'
            }),
            dataIndex: 'n1KDProductPlanQuantity',
        }, {
            title: formatMessage({
                id: 'tablePanel.column.n2KDProductPlanQuantity',
                defaultMessage: 'N+2月KD生产计划'
            }),
            dataIndex: 'n2KDProductPlanQuantity',
        }, {
            title: formatMessage({
                id: 'tablePanel.column.n3KDProductPlanQuantity',
                defaultMessage: 'N+3月KD生产计划'
            }),
            dataIndex: 'n3KDProductPlanQuantity',
        }, {
            title: formatMessage({
                id: 'tablePanel.column.n4KDProductPlanQuantity',
                defaultMessage: 'N+4月KD生产计划'
            }),
            dataIndex: 'n4KDProductPlanQuantity',
        }, {
            title: formatMessage({
                id: 'tablePanel.column.n5KDProductPlanQuantity',
                defaultMessage: 'N+5月KD生产计划'
            }),
            dataIndex: 'n5KDProductPlanQuantity',
        }, {
            title: formatMessage({
                id: 'tablePanel.column.n6KDProductPlanQuantity',
                defaultMessage: 'N+6月KD生产计划'
            }),
            dataIndex: 'n6KDProductPlanQuantity',
        }, {
            title: formatMessage({
                id: 'tablePanel.column.n7KDProductPlanQuantity',
                defaultMessage: 'N+7月KD生产计划'
            }),
            dataIndex: 'n7KDProductPlanQuantity',
        }, {
            title: formatMessage({
                id: 'tablePanel.column.n8KDProductPlanQuantity',
                defaultMessage: 'N+8月KD生产计划'
            }),
            dataIndex: 'n8KDProductPlanQuantity',
        }, {
            title: formatMessage({
                id: 'tablePanel.column.n9KDProductPlanQuantity',
                defaultMessage: 'N+9月KD生产计划'
            }),
            dataIndex: 'n9KDProductPlanQuantity',
        }, {
            title: formatMessage({
                id: 'tablePanel.column.n10KDProductPlanQuantity',
                defaultMessage: 'N+10月KD生产计划'
            }),
            dataIndex: 'n10KDProductPlanQuantity',
        }, {
            title: formatMessage({
                id: 'tablePanel.column.n11KDProductPlanQuantity',
                defaultMessage: 'N+11月KD生产计划'
            }),
            dataIndex: 'n11KDProductPlanQuantity',
        }, {
            title: formatMessage({
                id: 'tablePanel.column.n12KDProductPlanQuantity',
                defaultMessage: 'N+12月KD生产计划'
            }),
            dataIndex: 'n12KDProductPlanQuantity',
        }, {
            title: formatMessage({
                id: 'tablePanel.column.kdProductPlanQuantityTotal',
                defaultMessage: 'KD生产计划合计'
            }),
            dataIndex: 'kdProductPlanQuantityTotal',
        }, {
            title: formatMessage({
                id: 'tablePanel.column.status',
                defaultMessage: '状态'
            }),
            dataIndex: 'status',
            render: text => conventEnumValueToString(salePlanStatus, text)
        }, {
            title: formatMessage({
                id: 'tablePanel.column.creatorName',
                defaultMessage: '提报人'
            }),
            dataIndex: 'creatorName',
        }, {
            title: formatMessage({
                id: 'tablePanel.column.createTime',
                defaultMessage: '创建时间'
            }),
            dataIndex: 'createTime',
            render: text => formatDateTime(text, DATE_FORMAT)
        }, {
            title: formatMessage({
                id: 'tablePanel.column.remark',
                defaultMessage: '备注'
            }),
            dataIndex: 'remark',
        }];
        if(!this.props.isShowAbandonPanel && !this.props.isShowSubmitPanel)
            columns.push({
                title: formatMessage({
                    id: 'tablePanel.column.operate',
                    defaultMessage: '操作'
                }),
                dataIndex: 'operate',
                width: FIXED_COLUMN_WIDTH,
                fixed: 'right',
                render: (t, r) => {
                    const menus = [
                        {
                            id: PERMISSION.submit,
                            children: (ref =>
                                <WrappedPopconfirm
                                    key="submit"
                                    placement="topLeft"
                                    onConfirm={this.onClickSubmitBtn}
                                    onVisibleChange={ref.setMenuVisible}
                                    id={r.id}
                                    title={this.props.intl.formatMessage({
                                        id: 'tablePanel.validate.submit',
                                        defaultMessage: '是否确认生效？'
                                    })}>
                                    <a>{
                                        this.props.intl.formatMessage({
                                            id: 'tablePanel.submit',
                                            defaultMessage: '生效'
                                        })
                                    }</a>
                                </WrappedPopconfirm>
                            ),
                            hidden: !(hasPermissions(this.props.permissions, PERMISSION.submit) && hasPermissions(r.options, PERMISSION.submit)),
                        },
                        {
                            id: PERMISSION.abandon,
                            children: (ref =>
                                <WrappedPopconfirm
                                    key="abandon"
                                    placement="topLeft"
                                    onConfirm={this.onClickAbandonBtn}
                                    onVisibleChange={ref.setMenuVisible}
                                    id={r.id}
                                    title={this.props.intl.formatMessage({
                                        id: 'tablePanel.validate.abandon',
                                        defaultMessage: '是否确认作废？'
                                    })}>
                                    <a>{
                                        this.props.intl.formatMessage({
                                            id: 'tablePanel.abandon',
                                            defaultMessage: '作废'
                                        })
                                    }</a>
                                </WrappedPopconfirm>
                            ),
                            hidden: !(hasPermissions(this.props.permissions, PERMISSION.abandon) && hasPermissions(r.options, PERMISSION.abandon)),
                        }];
                    return <DropdownMenu key={r.id} menus={menus} primaryLength={1} id={r.id} />;
                }
            });
        const rowSelection = (this.props.isShowAbandonPanel || this.props.isShowSubmitPanel) ? {
            fixed: true,
            type: 'checkbox',
            columnWidth: ROWSELECTION_FIXED_COLUMN_WIDTH,
            // getCheckboxProps: record => ({
            //     disabled: !record.options.some(v => operats.includes(v))
            // }),
            selectedRowKeys: this.state.selectedRowKeys,
            onChange: this.onSelectedChange
        } : undefined;
        const submitMessage = (<Row>
            <Col span={18}>{
                formatMessage({
                    id: 'tablePanel.Validation.Message',
                    defaultMessage: '正在进行批量操作，点击右侧关闭将退出操作'
                })
            }</Col>
            <Col span={6} className="col-align-right">
                <Popconfirm id="batchSubmit" key="batchSubmit" getPopupContainer={this.getPopupContainer} title={formatMessage({
                    id: 'tablePanel.Validation.isContinue',
                    defaultMessage: '是否继续?'
                })}
                onConfirm={this.onClickBatchSubmit}>
                    <a className={styles.panelalertMessage} >{formatMessage({
                        id: 'tablePanel.btn.BatchSubmit',
                        defaultMessage: '批量提交'
                    })}</a>
                </Popconfirm>
            </Col>
        </Row>);
        const abandonMessage = (<Row>
            <Col span={18}>{
                formatMessage({
                    id: 'tablePanel.Validation.Message',
                    defaultMessage: '正在进行批量操作，点击右侧关闭将退出操作'
                })
            }</Col>
            <Col span={6} className="col-align-right">
                <Popconfirm id="batchAbandon" key="batchAbandon" getPopupContainer={this.getPopupContainer} title={formatMessage({
                    id: 'tablePanel.Validation.isContinue',
                    defaultMessage: '是否继续?'
                })}
                onConfirm={this.onClickBatchAbandon}>
                    <a className={styles.panelalertMessage} >{formatMessage({
                        id: 'tablePanel.btn.BatchAbandon',
                        defaultMessage: '批量作废'
                    })}</a>
                </Popconfirm>
            </Col>
        </Row>);
        return (
            <div>
                {this.props.isShowSubmitPanel && <Affix offsetTop={0} className={styles.alertMargin} onChange={this.affixOnChange}>
                    <Alert message={submitMessage} type="warning" closable showIcon
                        closeText={<span className={styles.closeText}>{formatMessage({
                            id: 'tablePanel.btn.close',
                            defaultMessage: '关闭'
                        })}</span>} onClose={this.onEndBatchOperationSubmit} />
                </Affix>}
                {this.props.isShowAbandonPanel && <Affix offsetTop={0} className={styles.alertMargin} onChange={this.affixOnChange}>
                    <Alert message={abandonMessage} type="warning" closable showIcon
                        closeText={<span className={styles.closeText}>{formatMessage({
                            id: 'tablePanel.btn.close',
                            defaultMessage: '关闭'
                        })}</span>} onClose={this.onEndBatchOperationAbandon} />
                </Affix>}
                <Table
                    className={'white-space-nowrap'}
                    columns={columns}
                    dataSource={this.props.data}
                    rowSelection={rowSelection}
                    loading={this.props.loading || this.state.loading}
                    onChange={this.onChangeSort}
                    pagination={pagination}
                    rowKey="id"
                    locale={locale}
                    {...TABLE}/>
            </div>
        );
    }
}
TablePanel.propTypes = {
    data: PropTypes.array.isRequired,
    loading: PropTypes.bool.isRequired,
    permissions: PropTypes.array.isRequired,
    total: PropTypes.number.isRequired,
    onChangeSort: PropTypes.func.isRequired,
    onEndBatchOperationAbandon: PropTypes.func.isRequired,
    onEndBatchOperationSubmit: PropTypes.func.isRequired,
    hasError: PropTypes.string,
    intl: PropTypes.object,
    pageIndex: PropTypes.number,
    pageSize: PropTypes.number,
    sortedColumnKey: PropTypes.string,
    sortedOrder: PropTypes.string,
};
import {connect} from 'react-redux';
import selectorFactory from 'Shared/utils/immutableToJsSelectorFactory';
import {tableSearch, clearAbandon, clearSubmit} from './actions';
import {injectIntl} from './intl';

const getData = selectorFactory(['page', 'domainData', 'list', 'data']);
const getPermissions = selectorFactory(['page', 'domainData', 'permission', 'data']);
const mapStateToProps = state => ({
    data: getData(state),
    loading: state.getIn(['page', 'domainData', 'list', 'isFetching']),
    hasError: state.getIn(['page', 'domainData', 'list', 'message']),
    total: state.getIn(['page', 'domainData', 'list', 'total']),
    pageIndex: state.getIn(['page', 'appState', 'queryBySort', 'pageIndex']),
    pageSize: state.getIn(['page', 'appState', 'queryBySort', 'pageSize']),
    sortedColumnKey: state.getIn(['page', 'appState', 'queryBySort', 'sortedColumnKey']),
    sortedOrder: state.getIn(['page', 'appState', 'queryBySort', 'sortedOrder']),
    permissions: getPermissions(state),
    isShowAbandonPanel: state.getIn(['page', 'ui', 'showAbandonPanel']),
    isShowSubmitPanel: state.getIn(['page', 'ui', 'showSubmitPanel']),
});

const mapDispatchToProps = dispatch => ({
    onChangeSort: option => dispatch(tableSearch(option)),
    refreshListData: () => dispatch(tableSearch()),
    onEndBatchOperationAbandon: () => dispatch(clearAbandon()),
    onEndBatchOperationSubmit: () => dispatch(clearSubmit()),
});

export default connect(mapStateToProps, mapDispatchToProps)(injectIntl(TablePanel));


